home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 16
/
AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso
/
pd
/
anwendungen
/
xpk_source
/
test
/
testsublibdata.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-08-27
|
4KB
|
143 lines
#define NAME "testSubLibData"
#define DISTRIBUTION "(Freeware) "
#define REVISION "3"
/* Programmheader
Name: testSubLibData
Author: SDI
Distribution: Freeware
Description: prints data of sub libraries
Compileropts: -
Linkeropts: -
1.1 06.12.96 : excluded PrintFlag functions
1.2 15.04.97 : renamed from GetXpkSubLibData
1.3 05.08.97 : needs no longer UPPER case arguments, now multiple
arguments
*/
#include <proto/xpksub.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <xpk/xpksub.h>
#include "SDI_defines.h"
#include "PrintFlags.c"
#define PARAM "LIBID/A/M"
struct Library *XpkSubBase = 0;
struct RDArgs *rda = 0;
ULONG DosVersion = 37;
UBYTE toup(UBYTE a)
{
if(a >= 'a' && a <= 'z')
return (UBYTE) (a+'A'-'a');
return a;
}
void WriteMode(struct XpkMode *, ULONG);
void main(void)
{
STRPTR name = "compressors/xpk____.library";
STRPTR *str;
if((rda = ReadArgs(PARAM, (LONG *) &str, 0)) && str)
{
for(;*str; ++str)
{
struct XpkInfo *xi;
STRPTR str2;
if((name[15] = toup((*str)[0])))
if((name[16] = toup((*str)[1])))
if((name[17] = toup((*str)[2])))
name[18] = toup((*str)[3]);
if((XpkSubBase = OpenLibrary(name, 0)) &&
(xi = XpksPackerInfo()))
{
VPrintf(
"xi_XpkInfoVersion : %d\n"
"xi_LibVersion : %d\n"
"xi_MasterVersion : %d\n"
"xi_ModesVersion : %d\n"
"xi_Name : %s\n"
"xi_LongName : %s\n"
"xi_Description : %s\n"
,xi);
str2 = (STRPTR) &(xi->xi_ID);
VPrintf("xi_ID : '%.4s'\nxi_Flags : ", &str2);
{
ULONG i = xi->xi_Flags;
PrintFlag(&i, XPKIF_PK_CHUNK, "XPKIF_PK_CHUNK");
PrintFlag(&i, XPKIF_PK_STREAM, "XPKIF_PK_STREAM");
PrintFlag(&i, XPKIF_PK_ARCHIVE, "XPKIF_PK_ARCHIVE");
PrintFlag(&i, XPKIF_UP_CHUNK, "XPKIF_UP_CHUNK");
PrintFlag(&i, XPKIF_UP_STREAM, "XPKIF_UP_STREAM");
PrintFlag(&i, XPKIF_UP_ARCHIVE, "XPKIF_UP_ARCHIVE");
PrintFlag(&i, XPKIF_HOOKIO, "XPKIF_HOOKIO");
PrintFlag(&i, XPKIF_CHECKING, "XPKIF_CHECKING");
PrintFlag(&i, XPKIF_PREREADHDR, "XPKIF_PREREADHDR");
PrintFlag(&i, XPKIF_ENCRYPTION, "XPKIF_ENCRYPTION");
PrintFlag(&i, XPKIF_NEEDPASSWD, "XPKIF_NEEDPASSWD");
PrintFlag(&i, XPKIF_MODES, "XPKIF_MODES");
PrintFlag(&i, XPKIF_LOSSY, "XPKIF_LOSSY");
PrintEndFlag(i, xi->xi_Flags);
}
VPrintf(
"xi_MaxPkInChunk : %ld\n"
"xi_MinPkInChunk : %ld\n"
"xi_DefPkInChunk : %ld\n"
"xi_PackMsg : %s\n"
"xi_UnpackMsg : %s\n"
"xi_PackedMsg : %s\n"
"xi_UnpackedMsg : %s\n"
"xi_DefMode : %d\n"
"xi_Pad : %d\n"
,&(xi->xi_MaxPkInChunk));
VPrintf("xi_Reserved : %ld,%ld,%ld,%ld,%ld,%ld\n", xi->xi_Reserved);
WriteMode(xi->xi_ModeDesc, 1);
}
}
}
if(XpkSubBase)
CloseLibrary(XpkSubBase);
if(rda)
FreeArgs(rda);
}
void WriteMode(struct XpkMode *m, ULONG num)
{
STRPTR str = (STRPTR) &(m->xm_Description);
VPrintf("\nXpkMode No %ld:\n", &num);
VPrintf("xm_Upto : %ld\nxm_Flags : ", &(m->xm_Upto));
{
ULONG i = m->xm_Flags;
PrintFlag(&i, XPKMF_A3000SPEED, "XPKMF_A3000SPEED");
PrintFlag(&i, XPKMF_PK_NOCPU, "XPKMF_PK_NOCPU");
PrintFlag(&i, XPKMF_UP_NOCPU, "XPKMF_UP_NOCPU");
PrintEndFlag(i, m->xm_Flags);
}
VPrintf(
"xm_PackMemory : %ld\n"
"xm_UnpackMemory : %ld\n"
"xm_PackSpeed : %ld\n"
"xm_UnpackSpeed : %ld\n"
"xm_Ratio : %d\n"
"xm_ChunkSize : %d\n"
, &(m->xm_PackMemory));
VPrintf("xm_Description : '%.10s'\n", &str);
if(m->xm_Next)
WriteMode(m->xm_Next, num+1);
}